#include <head.h>
int main(int argc, char const *argv[])
{
    if (3 != argc)
    {
        printf("格式错误 : %s file_dest file_src\n", argv[0]);
        return 0;
    }

    FILE *fp1 = fopen(argv[2], "r"); // 拷贝文件 src.txt
    FILE *fp2 = fopen(argv[1], "w"); // 目标文件 dest.txt
    FOPEN_ERR(fp1);
    FOPEN_ERR(fp2);
    char buf[1024];
    int byte = 0;
    while ((byte = fread(buf, 1, sizeof(buf), fp1)) != 0) // 从文件指针fp1中读取1024个字节到缓冲区buf中，返回读取的字节数
    {
        fwrite(buf, 1, byte, fp2);
    }
    fclose(fp1);
    fclose(fp2);
    return 0;
}
